package ModelLayer;

public class Loan
{
    // instance variables 
    private long id;
    private String borrowDate;
    private String period;
    private String state;
    //references to Person(p) and Copy(c) clases
    private Person p;
    private Copy c;
    /**
     * Constructor for objects of class Loan
     */
    public Loan(Person _p,Copy _c, long _id, String _borrowDate, String _period)
    {   
        p = _p;
        c =_c;
        id=_id;
        borrowDate = _borrowDate;
        period = _period;
        state = "Loaned";

    }

    /**
     * Accessors
     * */
    public long getID()
    {
        return id;
    }

    public String getDate()
    {
        return borrowDate;
    }

    public String getPeriod()
    {
        return period;
    }

    public String getState()
    {
        return state;
    }

    public Copy getCopy()
    {
        return c;
    }

    public Person getPerson()
    {
        return p;
    }
    
    /**
     * Mutators
     * */
    public void setDate(String _value)
    {
        borrowDate=_value;
    }

    public void setPeriod(String _value)
    {
        period=_value;
    }

    public void setState(String _value)
    {
        state=_value;
    }

}